|
ARD2
1.00 for Rev B. Hardware
Airbag Reference Demonstrator using MPC5604P
|
Drivers for serial link (SCI/UART/LIN) More...
Functions | |
| uint8_t | u8fnUARTWrite (const uint8_t u8Instance, const uint8_t *pu8UARTTx, const uint8_t u8Size) |
| This function will write n number of bytes to the UART. If this operation is not successful after some time, the routine will time-out. It will wait inside the function until all data has been transmitted. | |
| uint8_t | u8fnUARTRead (const uint8_t u8Instance, const uint8_t *pu8UARTRx, const uint8_t u8Size) |
| This function will read n number of bytes from the UART and place them in an array before exiting. If the number is not achieved, the routine will time-out eventually. | |
| uint8_t | u8fnLINUARTSend (const uint8_t u8Instance, const uint8_t *pu8UARTTx, const uint8_t u8Size) |
| This function will start writing data through the UART. The remaining data will be sent eventually through interrupts. It will NOT wait for all data to be sent before exiting. | |
| uint8_t | u8fnLINUARTReceive (const uint8_t u8Instance, const uint8_t *pu8UARTRx, const uint8_t u8IsrEn) |
| This function will enable data to be received via a UART, and will allow data to keep flowing in indefinitely. This function will NOT wait for data to be ready before it exits. | |
| uint8_t | u8fnConfigLINUARTGeneral (const LINUARTConfig_t *tLINUARTConfig) |
| This function will configure a particular instance of the LIN peripheral for use as a UART/SCI. | |
| uint8_t | u8fnLINUARTGetDataNoIsr (uint8_t u8Instance) |
| Gathers data from the buffer without using Isrs. | |
| uint8_t | u8fnWaitForUARTTxBufferToEmpty (uint8_t u8Instance, uint32_t u32TimeOut) |
| This function will wait for the Interrupts Enable bit to turn off or time-out while doing so. The purpose of such routine is to make sure not to start a new buffer transmission while there's one ongoing. | |
| void | vfnEnableLINTxISR (uint8_t u8Instance, uint8_t u8Switch) |
| This internal function will enable or disable transmission interrupts. | |
| void | vfnEnableLINRxISR (uint8_t u8Instance, uint8_t u8Switch) |
| This internal function will enable or disable Reception interrupts. | |
| void | vfnLIN0TxIsr (void) |
| Interrupt Service routine for data transmission of Instance 0. This routine will call vfnGenericLINTxIsr. | |
| void | vfnLIN1TxIsr (void) |
| Interrupt Service routine for data transmission of Instance 1. This routine will call vfnGenericLINTxIsr. | |
| void | vfnLIN2TxIsr (void) |
| Interrupt Service routine for data transmission of Instance 2. This routine will call vfnGenericLINTxIsr. | |
| void | vfnLIN3TxIsr (void) |
| Interrupt Service routine for data transmission of Instance 3. This routine will call vfnGenericLINTxIsr. | |
| void | vfnLIN0RxIsr (void) |
| Interrupt Service routine for data reception of Instance 0. This routine will call vfnGenericLINTxIsr. | |
| void | vfnLIN1RxIsr (void) |
| Interrupt Service routine for data reception of Instance 1. This routine will call vfnGenericLINTxIsr. | |
| void | vfnLIN2RxIsr (void) |
| Interrupt Service routine for data reception of Instance 2. This routine will call vfnGenericLINTxIsr. | |
| void | vfnLIN3RxIsr (void) |
| Interrupt Service routine for data reception of Instance 3. This routine will call vfnGenericLINTxIsr. | |
Variables | |
| vuint8_t | gau8LINUARTWordsTx [N_LIN_INSTANCES] |
| vuint8_t | gau8LINUARTWordsRx [N_LIN_INSTANCES] |
| vuint8_t | gau8LINUARTRxFlagHasBeenClearedByTx [N_LIN_INSTANCES] |
| vuint8_t * | gpu8LINUARTTxBuffer [N_LIN_INSTANCES] |
| vuint8_t * | gpu8LINUARTRxBuffer [N_LIN_INSTANCES] |
Drivers for serial link (SCI/UART/LIN)
Copyright (c) 2011 Freescale Semiconductor Freescale Confidential Proprietary
History:
| uint8_t u8fnConfigLINUARTGeneral | ( | const LINUARTConfig_t * | tLINUARTConfig | ) |
This function will configure a particular instance of the LIN peripheral for use as a UART/SCI.
| LINUARTConfig_t,: | pointer to a 32-bit word with relevant configuration. Refer to LINUARTConfig_t for more info. |
| uint8_t u8fnLINUARTGetDataNoIsr | ( | uint8_t | u8Instance | ) |
Gathers data from the buffer without using Isrs.
| u8Instance,: | Value determining the LIN instance to read from. |
| uint8_t u8fnLINUARTReceive | ( | const uint8_t | u8Instance, |
| const uint8_t * | pu8UARTRx, | ||
| const uint8_t | u8IsrEn | ||
| ) |
This function will enable data to be received via a UART, and will allow data to keep flowing in indefinitely. This function will NOT wait for data to be ready before it exits.
| u8Instance,: | Value determining the LIN instance from which data should be read. |
| pu8UARTRx,: | Pointer to RAM location where incoming data should be placed. |
| u8IsrEn,: | TRUE if Rx interrupts shall be used, CLEAR otherwise. |
| uint8_t u8fnLINUARTSend | ( | const uint8_t | u8Instance, |
| const uint8_t * | pu8UARTTx, | ||
| const uint8_t | u8Size | ||
| ) |
This function will start writing data through the UART. The remaining data will be sent eventually through interrupts. It will NOT wait for all data to be sent before exiting.
| u8Instance,: | Value determining the LIN instance from which data should be read. |
| pu8UARTTx,: | Pointer to data to transmit. |
| u8Size,: | Amount of bytes to write. |
| uint8_t u8fnUARTRead | ( | const uint8_t | u8Instance, |
| const uint8_t * | pu8UARTRx, | ||
| const uint8_t | u8Size | ||
| ) |
This function will read n number of bytes from the UART and place them in an array before exiting. If the number is not achieved, the routine will time-out eventually.
| u8Instance,: | Value determining the LIN instance from which data should be read. |
| pu8UARTRx,: | Pointer to RAM location where incoming data should be placed. |
| u8Size,: | Amount of bytes to be read. |
| uint8_t u8fnUARTWrite | ( | const uint8_t | u8Instance, |
| const uint8_t * | pu8UARTTx, | ||
| const uint8_t | u8Size | ||
| ) |
This function will write n number of bytes to the UART. If this operation is not successful after some time, the routine will time-out. It will wait inside the function until all data has been transmitted.
| u8Instance,: | Value determining the LIN instance from which data should be read. |
| pu8UARTTx,: | Pointer to data to transmit. |
| u8Size,: | Amount of bytes to write. |
| uint8_t u8fnWaitForUARTTxBufferToEmpty | ( | uint8_t | u8Instance, |
| uint32_t | u32TimeOut | ||
| ) |
This function will wait for the Interrupts Enable bit to turn off or time-out while doing so. The purpose of such routine is to make sure not to start a new buffer transmission while there's one ongoing.
| u8Instance,: | Value determining the LIN instance to write to. |
| u32TimeOut,: | Value to use as time-out. This value is decremented in a while loop. If it expires, an error flag UART_TIMEOUT is set. |
| void vfnEnableLINRxISR | ( | uint8_t | u8Instance, |
| uint8_t | u8Switch | ||
| ) |
This internal function will enable or disable Reception interrupts.
| u8Instance,: | Instance of the LIN module to operate on. |
| u8Switch,: | Non-zero to enable, zero to disable. |
| void vfnEnableLINTxISR | ( | uint8_t | u8Instance, |
| uint8_t | u8Switch | ||
| ) |
This internal function will enable or disable transmission interrupts.
| u8Instance,: | Instance of the LIN module to operate on. |
| u8Switch,: | Non-zero to enable, zero to disable. |
| void vfnLIN0RxIsr | ( | void | ) |
Interrupt Service routine for data reception of Instance 0. This routine will call vfnGenericLINTxIsr.
| void. |
| void vfnLIN0TxIsr | ( | void | ) |
Interrupt Service routine for data transmission of Instance 0. This routine will call vfnGenericLINTxIsr.
| void. |
| void vfnLIN1RxIsr | ( | void | ) |
Interrupt Service routine for data reception of Instance 1. This routine will call vfnGenericLINTxIsr.
| void. |
| void vfnLIN1TxIsr | ( | void | ) |
Interrupt Service routine for data transmission of Instance 1. This routine will call vfnGenericLINTxIsr.
| void. |
| void vfnLIN2RxIsr | ( | void | ) |
Interrupt Service routine for data reception of Instance 2. This routine will call vfnGenericLINTxIsr.
| void. |
| void vfnLIN2TxIsr | ( | void | ) |
Interrupt Service routine for data transmission of Instance 2. This routine will call vfnGenericLINTxIsr.
| void. |
| void vfnLIN3RxIsr | ( | void | ) |
Interrupt Service routine for data reception of Instance 3. This routine will call vfnGenericLINTxIsr.
| void. |
| void vfnLIN3TxIsr | ( | void | ) |
Interrupt Service routine for data transmission of Instance 3. This routine will call vfnGenericLINTxIsr.
| void. |
| vuint8_t gau8LINUARTRxFlagHasBeenClearedByTx[N_LIN_INSTANCES] |
SW flag that is set when there is pending Rx data but the HW flag has been cleared by the Tx Done HW action.
| vuint8_t gau8LINUARTWordsRx[N_LIN_INSTANCES] |
Number of words that have been received per instance
| vuint8_t gau8LINUARTWordsTx[N_LIN_INSTANCES] |
Number of words to be transmitted per instance
| vuint8_t* gpu8LINUARTRxBuffer[N_LIN_INSTANCES] |
Rx Global for 8-bit transfers
| vuint8_t* gpu8LINUARTTxBuffer[N_LIN_INSTANCES] |
Tx Global for 8-bit transfers